#@layout()

#define script()
<script>
    $('#testLink').click(function(event){
    	event.preventDefault(); 
    	var   $textArea = $('#db_config'),
        textArea   = $textArea.val();
    	$.ajax
        ({ 
            url: 'testDB',
            data: "db.config="+textArea,
            type: 'post',
            success: function(data)
            {
            	if(data.state=="ok")
            		toastr.success(data.msg)
            	else
            		toastr.error(data.msg)
            	//toastr.error(data.result.message)
            },
        	error: function(){
        		toastr.error("网路接口调用失败！ ")
        	}
        });
    });
</script>
#end
#define content()
<div class="content-wrapper">
    <section class="content-header">
        <h1>
              数据库设置
            <small>Db Setting</small>
        </h1>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header ">
                        <h3 class="box-title"></h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal form-setting" autocomplete="off"
                          id="optionForm">
                        <div class="box-body ">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">数据库参数</label>
                                <div class="col-sm-10">
                                    <textarea id="db_config" rows="15" class="form-control" placeholder="输入数据库配置"
                                           name="io.jpress.addon.oracle.db.config">#option("io.jpress.addon.oracle.db.config")</textarea>
                                </div>
                            </div>
 						</div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="col-sm-offset-2 col-sm-10 submit-block">
                                <div class="box-submit">
                                    <button type="submit" class="btn btn-primary">提交</button>
                                    <button id="testLink" class="btn btn-primary">测试</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
#end
